<%@page import="com.car.entity.CarSeach"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>汽车信息显示列表</title>
<!-- 引入JQuery -->
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/jquery-easyui-1.5.2/jquery.min.js"></script>
<!-- 引入EasyUI -->
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
<!-- 引入EasyUI的中文国际化js，让EasyUI支持中文 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/jquery-easyui-1.5.2/locale/easyui-lang-zh_CN.js"></script>
<!-- 引入EasyUI的样式文件-->
<link rel="stylesheet" href="${pageContext.request.contextPath}/statics/jquery-easyui-1.5.2/themes/default/easyui.css" type="text/css"/>
<!-- 引入EasyUI的图标样式文件-->
<link rel="stylesheet" href="${pageContext.request.contextPath}/statics/jquery-easyui-1.5.2/themes/icon.css" type="text/css"/>



<style type="text/css">
	input{
		border-radius: 5px;
	}
	span{
		font-size: 10px;
		font-weight: bold;
	}
</style>

</head>
<body>
<%

CarSeach caeseach = (CarSeach)request.getSession().getAttribute("seach");
Integer carSupplier = null;
if(caeseach!=null){
	carSupplier = caeseach.getCarSupplier();
}
%>
<script type="text/javascript">
$(function(){
	var carSupplier = $("#carSupplier");
	$.ajax({
		type:"GET",//请求类型
		url:"../carManager/getSupportList",//请求的url
		//data:{method:"getrolelist"},请求参数
		dataType:"json",//ajax接口（请求url）返回的数据类型
		success:function(data){//data：返回数据（json对象）
			if(data){
				//alert(data.length);
				carSupplier.html("");
				var options = "<option value=\"0\" selected=\"selected\">--请选择--</option>";
				for(var i = 0; i < data.length; i++){
					if(<%=carSupplier%>!=null){
						if(data[i].id==<%=carSupplier %>){
							options += "<option value=\""+data[i].id+"\" selected >"+data[i].name+"</option>";
						}else{
							options += "<option value=\""+data[i].id+"\">"+data[i].name+"</option>";
						}
					}else{
						options += "<option value=\""+data[i].id+"\">"+data[i].name+"</option>";
					}
				}
				carSupplier.html(options);
			}
			
		}
	});
});
</script>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/listcar.js"></script>



<div style="margin-top: 30px;"></div>
<form style="margin-left: 30px;" action="${pageContext.request.contextPath }/carManager/CarListBySeach" method="post">
	<span>汽车型号:</span>&nbsp;<input type="text" id="carType" name="carType" value="${seach.carType }" >&nbsp;&nbsp;&nbsp;&nbsp;
	<span>供应商:</span>&nbsp;
	<select name="carSupplier" id="carSupplier">
	</select>
	<!-- <input type="text" name="carSupplier"> -->&nbsp;&nbsp;&nbsp;&nbsp;
	<span>价格:</span>&nbsp;<input type="text" name="price" id="price" value="${seach.price }">&nbsp;&nbsp;&nbsp;&nbsp;
	<span>驱动方式:</span>&nbsp;<input type="text" name="driveType" id="driveType" value="${seach.driveType }">
	<%-- <input type="hidden" name="pagesize" value="${page.pagesize }">&nbsp; --%>
	<input type="submit" value="搜  索">
</form>

<div style="margin-top: 40px;"></div>

<%-- <a href="${pageContext.request.contextPath }/CarManager/addcar1.jsp" ><button><img alt="" src="${pageContext.request.contextPath }/statics/images/add.gif">&nbsp;添加新的车型</button></a>
 --%>

<table id="tt"></table>

<div id="dd"></div>
<div style="margin: 30px 0px 0 30px ;">
	<p>仓库录入车型共有：${total }28 种</p>
	<p>本年度新增车型有：${newadd }7种</p>
	<p>移除的车型有：${delcar }6种</p>
</div>
</body>
</html>